import api from "./api";
import type Typings from "@/typings";

export default {
  userListApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/user/list";
    return api.get(url, data, { ...config });
  },

  userAddApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/user/add";
    return api.post(url, data, { ...config, openLoading: true });
  },

  userUpdateApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/user/update";
    return api.post(url, data, { ...config, openLoading: true });
  },

  userCheckApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/user/check";
    return api.get(url, data, { ...config });
  },

  userRemoveApi: (
    data: Typings.Common.plainObj = {},
    config: Typings.Common.plainObj = {}
  ) => {
    const url = "/user/remove";
    return api.get(url, data, { ...config });
  },
};
